package string;

import java.util.HashMap;
import java.util.Map;

/**
 * String StringBuilder StringBuffer 比较
 * 速度：StringBuilder >  StringBuffer  >  String
 * @author 12609
 *
 */
public class Demo {
	
	class Inner {}
	public static void foo() { new Demo().new Inner();}
	
	
	public static void main(String[] args) {
		
		/**
		 * 先创建对象s赋予“hello word”，第二步实际上是先销毁s对象，再创建一个新的s对象并赋值
		 */
		String s = "hello word";
		s = s + " man !";
		
		StringBuffer sBuffer = new StringBuffer();
		sBuffer.append("fuck");
		
		StringBuilder sBuilder = new StringBuilder();
		sBuilder.append("you");
		
		//== 判断引用是否相等  equals判断内容
		String s1 = "Programming";
		String s2 = new String("Programming");
		String s3 = "Program";
		String s4 = "ming";
		String s5 = "Program"+"ming";
		String s6 = s3 + s4;
		System.err.println(s1 == s2);
		System.err.println(s1 == s5);
		System.err.println(s1 == s6);
		System.err.println(s1 == s6.intern());
		System.err.println(s2 == s2.intern());
		
		char a = '龙';
		System.out.println(a);
		
		Map<String, String> map = new HashMap<>();
		
		System.out.println(1 << 5);
		
	}

}
